home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / X11 / extensions / xtraplib.h < prev    next >
C/C++ Source or Header  |  2006-04-12  |  5KB  |  129 lines

  1. /* $XFree86$ */
  2. #ifndef __XTRAPLIB__
  3. #define __XTRAPLIB__ 
  4.  
  5.  
  6. /*****************************************************************************
  7. Copyright 1987, 1988, 1989, 1990, 1991, 1994 by Digital Equipment Corp., 
  8. Maynard, MA
  9.  
  10. Permission to use, copy, modify, and distribute this software and its 
  11. documentation for any purpose and without fee is hereby granted, 
  12. provided that the above copyright notice appear in all copies and that
  13. both that copyright notice and this permission notice appear in 
  14. supporting documentation, and that the name of Digital not be
  15. used in advertising or publicity pertaining to distribution of the
  16. software without specific, written prior permission.  
  17.  
  18. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  19. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  20. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  21. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  22. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  23. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  24. SOFTWARE.
  25.  
  26. *****************************************************************************/
  27. /*
  28.  *
  29.  *  CONTRIBUTORS:
  30.  *
  31.  *      Dick Annicchiarico
  32.  *      Robert Chesler
  33.  *      Dan Coutu
  34.  *      Gene Durso
  35.  *      Marc Evans
  36.  *      Alan Jamison
  37.  *      Mark Henry
  38.  *      Ken Miller
  39.  *
  40.  *  DESCRIPTION:
  41.  *      This header file describes all the structures/constants required
  42.  *      for interfacing with the client toolkit *except* the common
  43.  *      client/extension definitions in xtrapdi.h.  Namely, *no* extension-
  44.  *      only information or client/extension information can be found here.
  45.  */
  46. #ifdef SMT
  47. #define NEED_EVENTS
  48. #define NEED_REPLIES
  49. #endif
  50. #include <X11/Xlib.h>
  51. #include <X11/Intrinsic.h>
  52. #include <X11/extensions/xtrapdi.h>
  53. #include <X11/extensions/xtrapemacros.h>
  54.  
  55. typedef struct  /* Callback structure */
  56. {
  57.     void_function func;
  58.     BYTE          *data;
  59. } XETrapCB;
  60.  
  61. /* Data structure for setting trap context */
  62. typedef struct
  63. {
  64.     CARD8       tc_flags[2L];  /* Toolkit-side specific flags */
  65.     XETrapCfg   v;             /* XTrap configuration values */
  66.     XETrapCB    *req_cb;       /* Pointer to Request Callbacks */
  67.     XETrapCB    *evt_cb;       /* Pointer to Event Callbacks (starting at 2) */
  68.     CARD32      last_time B32; /* Last (delta) timestamp */
  69. } XETCValues;
  70.  
  71.     /* bits 0 thru 6 are formerly "families" (now obsolete) */
  72. #define XETCDeltaTimes             7
  73. #define XETCTrapActive             8
  74.     /* bits 9 thru 15 are reserved for future expansion */
  75.  
  76. /* Values bit masks (used when determining what's dirty */
  77. #define TCStatistics               (1L<<0L)
  78. #define TCRequests                 (1L<<1L)
  79. #define TCEvents                   (1L<<2L)
  80. #define TCMaxPacket                (1L<<3L)
  81. #define TCCmdKey                   (1L<<4L)
  82. #define TCTimeStamps               (1L<<5L)
  83. #define TCWinXY                    (1L<<6L)
  84. #define TCXInput                   (1L<<7L)
  85. #define TCReqCBs                   (1L<<8L)
  86. #define TCEvtCBs                   (1L<<9L)
  87. #define TCCursor                   (1L<<10L)
  88. #define TCColorReplies             (1L<<11L)
  89. #define TCGrabServer               (1L<<12L)
  90.  
  91. /* This is the representation we use in the library code for XLib transport */
  92. typedef struct {
  93.     int type;
  94.     unsigned long serial;
  95.     Bool synthetic;
  96.     Display *display;
  97.     int detail;
  98.     unsigned long idx;
  99.     unsigned char data[sz_EventData];
  100. } XETrapDataEvent;
  101.  
  102. /* Trap Context structure for maintaining XTrap State for client */
  103. typedef struct _XETC 
  104. {
  105.     struct _XETC *next;         /* Ptr to next linked-listed TC */
  106.     Display      *dpy;          /* Display ptr of current TC */
  107.     INT32        eventBase /*B32*/; /* First event value */
  108.     INT32        errorBase /*B32*/; /* First error value */
  109.     INT32        extOpcode /*B32*/; /* Major opcode of the extension */
  110.     BYTE         *xbuff;        /* Pointer to buffer for XLib Communications */
  111.     CARD16       xmax_size /*B16*/; /* Max Size of a request */
  112.     XExtData     *ext_data;     /* hook for extension to hang data */
  113.     /* 
  114.      *  The following are initialized with the client-side version number
  115.      *  However, when either a GetAvailable or GetVersion reply is received,
  116.      *  these values are updated with the *oldest* version numbers.
  117.      */
  118.     CARD16       release /*B16*/;   /* The extension release number */
  119.     CARD16       version /*B16*/;   /* The xtrap extension version number */
  120.     CARD16       revision /*B16*/;  /* The xtrap extension revision number */
  121.     CARD16       protocol /*B16*/;  /* The xtrap extension protocol number */
  122.     unsigned     dirty /*B32*/;     /* cache dirty bits */
  123.     XETCValues   values;        /* shadow structure of values */
  124.     Boolean      (*eventFunc[XETrapNumberEvents])(XETrapDataEvent *event, struct _XETC *tc);
  125. } XETC;
  126.  
  127.  
  128. #endif /* __XTRAPLIB__ */
  129.